<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.bootcdn.net/ajax/libs/normalize/8.0.1/normalize.min.css" rel="stylesheet">
    <title>选择器权重</title>
    <style>
        main{
            width: 200px;
            height: 200px;
            background-color: red;
            border: 10px solid #ccc;
        }
        main[data-num]{
            width: 300px;
        }
        main[data-num*="2"]{
            width: 200px !important;
        }
    </style>
</head>
<body>
    <main data-num="1">
1
    </main>
    <main data-num="2">
2
    </main>
    <main data-num="1323456" style="width: 100px;" >
        23456
    </main>
    <main data-num="3">
3
    </main>
</body>
</html>